use std::ffi::c_void;

use crate::types;

unsafe extern "C" {
  fn game_global_gps_get_coordinate() -> *const c_void;
  fn game_global_gps_get_dimensions() -> *const c_void;
  fn game_global_gps_get_color_info() -> *const c_void;
  fn game_global_gps_top_in_use() -> bool;
}

pub fn global_gps_get_coordinate() -> &'static types::Coordinate {
  unsafe { (game_global_gps_get_coordinate() as *const types::Coordinate).as_ref_unchecked() }
}

pub fn global_gps_get_dimensions() -> &'static types::Dimensions {
  unsafe { (game_global_gps_get_dimensions() as *const types::Dimensions).as_ref_unchecked() }
}

pub fn global_gps_get_color_info() -> &'static types::ColorInfo {
  unsafe { (game_global_gps_get_color_info() as *const types::ColorInfo).as_ref_unchecked() }
}

pub fn global_gps_top_in_use() -> bool {
  unsafe { game_global_gps_top_in_use() }
}
